//
//  MovieListSameCollectionViewCell.m
//  UI_豆瓣项目
//
//  Created by dllo on 15/11/4.
//  Copyright (c) 2015年 关业达. All rights reserved.
//

#import "MovieListSameCollectionViewCell.h"
#import "UIImageView+WebCache.h"
@implementation MovieListSameCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubViews];
    }
    return self;
}

- (void)createSubViews
{
    self.headImageView = [[UIImageView alloc] initWithFrame:self.contentView.bounds];
    [self.contentView addSubview:self.headImageView];
    [_headImageView release];
    
    self.movieNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 120, 90, 20)];
    self.movieNameLabel.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:self.movieNameLabel];
    [_movieNameLabel release];

}

- (void)setMyMovie:(Movie *)myMovie
{
    if (_myMovie != myMovie) {
        [_myMovie release];
        _myMovie = [myMovie retain];
    }
    self.movieNameLabel.text = myMovie.movieName;
    
    NSURL *url = [NSURL URLWithString:self.myMovie.pic_url];
    [self.headImageView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"1.jpg"]];
}













@end
